MuleSoft Accelerator for Retail
Use case 4 - Real-time inventory management
The Real-time inventory management use case enables customers to make an informed decision of their online purchase based on real-time inventory of a product in nearby stores.
Contents
- Glossary
- Goals
- Considerations
- End-to-end scenarios
- Solution definition
- Assumptions and constraints
- High-level architecture
- Sequence diagram
- Processing logic
- Success conditions
See also
Description
The real-time inventory sync use case enables retail developers to retrieve the most up-to-date inventory information for a given product or list of products across relevant applications. Developers can configure in-stock inventory per location to provide faster shipping times and better service for customers.
The real-time inventory sync achieves the following goals:
- Builds an informative user experience for both customers and employees to access more accurate inventory information
- Reinforces headless "omnichannel" interaction by seamlessly providing inventory information across channels
- Reduces the risk of overselling and lost revenue
Glossary
Term | Definition |
---|---|
CIM | The Cloud Information Model (CIM) defines a set of standard data structures that can be used as canonical representations of common entities for integrating systems. |
MDM | A Master Data Management (MDM) solution provides an accurate, consistent, and complete copy of golden data for use by enterprise applications and business partners. Most solutions include data quality tools and workflow processes for managing conflicting updates. |
PIM | The system responsible for managing product information for sales orders. |
Goals
- Display the product’s availability on Salesforce B2C’s product description page and checkout page in real-time.
- Display the product’s availability on Salesforce Service Cloud/Sales Cloud at the associated stores in real-time.
- Support the creation of orders across relevant applications, inclusive of Salesforce core, SAP S/4HANA, OFBiz (OMS), and B2C Commerce Cloud.
- Support the creation of Universal ID and ID attribution.
Use case considerations
- Must support the change in inventory in SAP S/4HANA for the product that was ordered from B2C at a given store.
- Safety Stock is configured in SAP S/4HANA, which is used for replenishment and represents the minimum possible quantity capable of supporting a replacement time that is longer than the programmed one or a disproportionate consumption. It is set at the product and plant level. When the stock decreases to that quantity, a purchase order or a production order is automatically triggered for replenishment.
Technical considerations
- Stores in B2C Commerce Cloud are manually set up and each store has an inventory list associated with it. For the purpose of this use case, three stores will be set up using the B2C Account Manager. The inventory associated with these stores can be retrieved in real-time from the B2C Storefront on the product description page and the checkout page. Additionally, a batch process can be set up to feed inventory to these stores.
- Stores in Salesforce Sales Cloud/Service Cloud are manually set up and inventory for these stores can be retrieved in real-time.
- The Orders Sync use case is leveraged to orchestrate the order creation in SAP S/4HANA.
- The shipping charge in the order will be $0 since the products will be selected to be picked up in-store. This should reflect in the Order details in Salesforce Service Cloud/Sales Cloud.
- The Product Sync Use case is leveraged to sync products between B2C Commerce Cloud and SAP S/4HANA.
- The Products in B2C are configured to be available for pick up in-store.
- The Products in SAP S/4 HANA are configured to be created for multiple plants.
- The MDM system is used to lookup products to correlate the products in B2C commerce cloud and Salesforce Service Cloud/Sales Cloud with products in SAP S/4HANA.
- Use CIM as the canonical model.
- Build using top applications, inclusive of Salesforce products, but should be built to work with other endpoints as well. For this solution, leverage the following applications:
- Salesforce B2C Commerce (CC)
- Salesforce Core (Sales, Service, and B2B CC)
- SAP S/4HANA.
End-to-end scenarios
- Stores in B2C Commerce Cloud show the real-time inventory for the product from SAP S/4HANA.
- Stores in Salesforce Service Cloud/Sales Cloud show the real-time inventory for the product from SAP S/4HANA.
- Order placed in B2C Commerce Cloud is created in SAP S/4HANA.
Systems involved
- Salesforce B2C Commerce (CC)
- SAP S/4HANA
- PIM Database (generic)
- MDM (generic)
Solution definition
This version enables the B2C Commerce Cloud and Service Cloud/Sales Cloud platforms to retrieve the most up-to-date inventory information for a given product or a list of products.
Before you begin
The Accelerators setup guide provides general information on getting started with the accelerator components. This includes instructions on setting up your local workstation for configuring and deploying the applications. |
Goal
The goal is to display real-time inventory of the product in B2C Commerce Cloud and Salesforce Service Cloud/Sales Cloud.
Steps
- Select a product on B2C Commerce Cloud’s storefront.
- On the product description page, select Pickup in-store and enter the zip code.
- Retrieve the inventory in real-time and display it in the 'Available Quantity' field along with the Store Details.
- At the checkout page, the radio button for 'Pick Up In-Store' will be selected by default, and the shipping fee is set to zero dollars.
- To retrieve the inventory in real-time, the B2C Commerce Cloud Experience API will be invoked to check for inventory again.
- Publish the order created in B2C Commerce Cloud to SAP S/4HANA.
Use case extension
If no match is found, create a new entry in MDM.
Assumptions and constraints
The following will be used to guide or constrain the solution design at a high level:
- The Cloud Information Model (CIM) will be used as the canonical model for all business types; see the CIM usage guidelines in the Appendix.
- Three stores are manually configured in B2C Commerce Cloud and Salesforce Service Cloud/Sales Cloud.
- The stores in B2C Commerce Cloud and Salesforce Service Cloud/Sales Cloud are mapped to Plant in SAP S/4HANA. The process layer will have this mapping as a configuration.
- The Safety Stock is in SAP S/4HANA. This can be configured manually or programmatically using the SAP S/4HANA Products System API in the Product Sync use case.
High-level architecture
Sequence diagram
The following diagram illustrates the sequence of processing the real-time inventory check of a product from B2C Storefront:
Processing logic
The primary handling and orchestration of real-time inventory checks will be implemented in the Inventory Process API. This process can be described as follows:
- The product and the selected stores will be sent to the Inventory Process API.
- Find a matching product entry in MDM. The lookup will be done by attempting to match the following criteria, in sequential order, returning once a match has been found:
- Universal Identifier (if provided)
- External Identifier (of source system)
- If a single match is found:
- Retrieve the existing product
- Retrieve the corresponding product ID for SAP S/4HANA.
- Invoke the SAP S/4HANA Product Availability System API.
- Return the response to the B2C Commerce Cloud Experience API.
- Update the inventory in the B2C Commerce System API.
Success conditions
After successfully completing the update processing for all target systems, the following conditions will be met:
- B2C Commerce Cloud displays the real-time inventory information on the product description page and the checkout page.
- Salesforce Service Cloud/Sales Cloud displays the real time inventory information of a product at the associated stores.
- The Order is successfully created with a zero-dollar shipping fee.
- The Order ID Graph in Salesforce Service Cloud/Sales Cloud shows the order created in various downstream systems where SAP S/4HANA is the relevant system for this use case.
Mappings
Source type mappings
The following table summarizes how representations of a product from each system will be mapped to CIM types:
Source System | Source Type | CIM Types | Mapping Notes |
---|---|---|---|
B2C Commerce | Product | Product ProductCategory ProductCatalog PriceBook |
Relevant fields only |
OFBiz | Product | Product ProductCategory ProductCatalog PriceBook |
Relevant fields only |
SAP S/4HANA | Product | Product ProductCategory ProductCatalog PriceBook |
Relevant fields only |
Salesforce | Product Pricebook |
Product ProductCategory ProductCatalog PriceBook |
Relevant fields only |
PIM | Product ProductCategory ProductCatalog PriceBook |
Product ProductCategory ProductCatalog PriceBook |
1:1 mappings; use join tables for relationships |
Target type mappings
The following table summarizes how representations of a product from each system will be mapped from CIM types:
Target System | CIM Type | Target Types | Mapping Notes |
---|---|---|---|
B2C Commerce | Product ProductCategory ProductCatalog PriceBook |
Product | Relevant fields only and 'availableForPickupInstore' is a custom attribute |
OFBiz | Product ProductCategory ProductCatalog PriceBook |
Product ProductCategory ProductCatalog PriceBook |
Relevant fields only |
SAP S/4HANA | Product PriceBook |
Product PricingCondition |
Relevant fields only; Products are mapped to more than one plant to correspond to the stores in B2C |
Salesforce | Product ProductCategory ProductCatalog PriceBook |
Product PriceBook |
Relevant fields only |
PIM | Product ProductCategory ProductCatalog PriceBook |
Product | Relevant fields only |
Downloadable assets
Accelerator System APIs
- B2C Commerce System API | API Specification | Implementation Template
- SAP S/4HANA Orders System API | API Specification | Implementation Template
- SAP S/4HANA Product Availability System API | API Specification | Implementation Template
- SAP S/4HANA Products System API | API Specification | Implementation Template
Accelerator Process APIs
- Inventory Process API | API Specification | Implementation Template
Accelerator Experience APIs
- B2C Commerce Experience API | API Specification | Implementation Template
- Salesforce Experience API | API Specification | Implementation Template
Custom components
- B2C Commerce Instore Pickup Cartridge | Source
- B2C Commerce Sync Cartridge | Source
- Product Availability Lightning Web Component | Source